#include<string.h>
#include<stdlib.h>
#include<stdio.h>

#include"util.h"

int dbd_get_target_obj(char *argv, char *obj){
	char obj_cmd[] = "-o";
	int index = strstr(argv, obj_cmd) - argv;
	if(index < 0){
		fprintf(stderr, "Can't not fidn obj from\n%s\n", argv);
		return -1;
	}
	index += strlen(obj_cmd)+1;
	int n = strchr(argv+index, ' ') - argv - index;
	strncpy(obj, argv+index,n);
	return 0;
}


